/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.obeonetwork.dsl.spem.extension.spem_ifest.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import org.obeonetwork.dsl.spem.extension.spem_ifest.*;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class Spem_ifestFactoryImpl extends EFactoryImpl implements Spem_ifestFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static Spem_ifestFactory init() {
		try {
			Spem_ifestFactory theSpem_ifestFactory = (Spem_ifestFactory)EPackage.Registry.INSTANCE.getEFactory("org.obeonetwork.dsl.spem.extension.spem_ifest"); 
			if (theSpem_ifestFactory != null) {
				return theSpem_ifestFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new Spem_ifestFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Spem_ifestFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case Spem_ifestPackage.ENGINEERING_DOMAIN: return createEngineeringDomain();
			case Spem_ifestPackage.TOOL_DEFINITION: return createToolDefinition();
			case Spem_ifestPackage.VIEWPOINT: return createViewpoint();
			case Spem_ifestPackage.TASK_DEFINITION: return createTaskDefinition();
			case Spem_ifestPackage.ARTIFACT_DEFINITION: return createArtifactDefinition();
			case Spem_ifestPackage.SPEM_IFEST: return createSPEM_IFEST();
			case Spem_ifestPackage.TOOL_TYPE: return createToolType();
			case Spem_ifestPackage.ENGINEERING_DOMAIN_PACKAGE: return createEngineeringDomainPackage();
			case Spem_ifestPackage.TOOL_TYPE_PACKAGE: return createToolTypePackage();
			case Spem_ifestPackage.META_MODEL: return createMetaModel();
			case Spem_ifestPackage.META_MODEL_PACKAGE: return createMetaModelPackage();
			case Spem_ifestPackage.ONTOLOGY_LINKED_ELEMENT: return createOntologyLinkedElement();
			case Spem_ifestPackage.ARTIFACT_DEFINITION_PACKAGE: return createArtifactDefinitionPackage();
			case Spem_ifestPackage.ARTIFACT: return createArtifact();
			case Spem_ifestPackage.ACTIVITY: return createActivity();
			case Spem_ifestPackage.ARTIFACT_TRANSFORMATION: return createArtifactTransformation();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object createFromString(EDataType eDataType, String initialValue) {
		switch (eDataType.getClassifierID()) {
			case Spem_ifestPackage.LEVEL:
				return createLevelFromString(eDataType, initialValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String convertToString(EDataType eDataType, Object instanceValue) {
		switch (eDataType.getClassifierID()) {
			case Spem_ifestPackage.LEVEL:
				return convertLevelToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EngineeringDomain createEngineeringDomain() {
		EngineeringDomainImpl engineeringDomain = new EngineeringDomainImpl();
		return engineeringDomain;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ToolDefinition createToolDefinition() {
		ToolDefinitionImpl toolDefinition = new ToolDefinitionImpl();
		return toolDefinition;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Viewpoint createViewpoint() {
		ViewpointImpl viewpoint = new ViewpointImpl();
		return viewpoint;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TaskDefinition createTaskDefinition() {
		TaskDefinitionImpl taskDefinition = new TaskDefinitionImpl();
		return taskDefinition;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ArtifactDefinition createArtifactDefinition() {
		ArtifactDefinitionImpl artifactDefinition = new ArtifactDefinitionImpl();
		return artifactDefinition;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SPEM_IFEST createSPEM_IFEST() {
		SPEM_IFESTImpl speM_IFEST = new SPEM_IFESTImpl();
		return speM_IFEST;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ToolType createToolType() {
		ToolTypeImpl toolType = new ToolTypeImpl();
		return toolType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EngineeringDomainPackage createEngineeringDomainPackage() {
		EngineeringDomainPackageImpl engineeringDomainPackage = new EngineeringDomainPackageImpl();
		return engineeringDomainPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ToolTypePackage createToolTypePackage() {
		ToolTypePackageImpl toolTypePackage = new ToolTypePackageImpl();
		return toolTypePackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MetaModel createMetaModel() {
		MetaModelImpl metaModel = new MetaModelImpl();
		return metaModel;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MetaModelPackage createMetaModelPackage() {
		MetaModelPackageImpl metaModelPackage = new MetaModelPackageImpl();
		return metaModelPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public OntologyLinkedElement createOntologyLinkedElement() {
		OntologyLinkedElementImpl ontologyLinkedElement = new OntologyLinkedElementImpl();
		return ontologyLinkedElement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ArtifactDefinitionPackage createArtifactDefinitionPackage() {
		ArtifactDefinitionPackageImpl artifactDefinitionPackage = new ArtifactDefinitionPackageImpl();
		return artifactDefinitionPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Artifact createArtifact() {
		ArtifactImpl artifact = new ArtifactImpl();
		return artifact;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Activity createActivity() {
		ActivityImpl activity = new ActivityImpl();
		return activity;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ArtifactTransformation createArtifactTransformation() {
		ArtifactTransformationImpl artifactTransformation = new ArtifactTransformationImpl();
		return artifactTransformation;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Level createLevelFromString(EDataType eDataType, String initialValue) {
		Level result = Level.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertLevelToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Spem_ifestPackage getSpem_ifestPackage() {
		return (Spem_ifestPackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static Spem_ifestPackage getPackage() {
		return Spem_ifestPackage.eINSTANCE;
	}

} //Spem_ifestFactoryImpl
